<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="购物车.css">
    <link rel="stylesheet" href="./font/iconfont.css">
</head>

<body>
    <div class="box">
        <div id="app">
            <div class="top">
                <div class="check">已选商品</div>
                <div class="delete"><span class="iconfont icon-shanchu"></span> 清空</div>
            </div>
            <div class="list">
                <div class="item" v-for="(item,index) in foodlist" v-bind:key="index">
                    <div class="left">
                        <img v-bind:src="item.pic" alt="">
                        <div class="content">
                            <div class="name">{{ item.name }}</div>
                            <div class="discount">￥{{ item.price }}<span class="before">{{item.before}}</span> </div>
                        </div>
                    </div>
                    <div class="right">
                        <span v-bind:class=" item.jian"></span>
                        <span class="number">{{item.number}}</span>
                        <span v-bind:class=" item.change"></span>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="bottom">
            <div class="count">
                <img src="./images/4.gif" alt="">
                <div class="sum">
                    <span class="actually">￥528</span>
                    <span class="origin">￥531</span>
                    <div class="transparent">另需配送费36元</div>
                </div>
            </div>
            <button class="pay">去结算</button>
        </div>
    </div>
</body>

</html>
<script src="./vue-2.5.21.js"></script>
<script>
    //实例化Vue对象
    var v = new Vue({
        //Vue实例挂载的dom节点
        el: '#app',
        data: {
            foodlist: [
                { id: 1, pic: './images/1.gif', name: "秋刀鱼/斤", price: 35, before: 36, jian: "iconfont icon-jianshao", number: 1, change: "iconfont icon-zengjia" },
                { id: 2, pic: './images/2.gif', name: "鲜大带鱼/斤", price: 45, before: 46, jian: "iconfont icon-jianshao", number: 1, change: "iconfont icon-zengjia" },
                { id: 3, pic: './images/3.gif', name: "鲜活全母皮皮虾/斤", price: 85, before: 86, jian: "iconfont icon-jianshao", number: 1, change: "iconfont icon-zengjia" },
                { id: 4, pic: './images/3.gif', name: "13-15头鲍鱼/只", price: 85, before: 86, jian: "iconfont icon-jianshao", number: 1, change: "iconfont icon-zengjia" }
            ]
        }

    })
</script>